home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / tex / rexx / requestfile.mg < prev    next >
Text File  |  1991-03-18  |  974b  |  33 lines

  1. /*
  2.  * Just for grins - go get a file name via the ARP file requrester,
  3.  * and then load the file.
  4.  */
  5.  
  6. /* Add the library */
  7. if ~show('Libraries', 'rexxarplib.library') then
  8.     if ~addlib('rexxarplib.library', 0, -30, 0) then do
  9.         call log 1, "No rexxarp library, exiting!"
  10.         exit 20
  11.         end
  12.  
  13. newfile = GetFile(20, 20, pragma('Directory'), '', 'Find File?')
  14.  
  15. /* Check for CANCEL or no file selected */
  16. if newfile = "" then exit 2
  17.  
  18. /*
  19.  * Check for directory selected, in which case I die (no dired). Those who
  20.  * use may wish to invoke it at this point.
  21.  */
  22. if index("/:", right(newfile, 1)) ~= 0 then exit 1
  23.  
  24. /*
  25.  * Finally, do a find-file. I use this for pedegogical reasons; those
  26.  * who really want requesters everywhere might want to copy this file,
  27.  * and change the command/hailstring for other commands (or maybe create
  28.  * a single Rexx script that takes two arguments, the hailstring & command,
  29.  * and uses this in the appropriate places.
  30.  */
  31. 'find-file' newfile
  32. exit rc
  33.